# _*_ coding: UTF-8 _*_
# @Time     :2023-11-13 11:11
# @Author   :Yunlian Zeng
# @File     :client_demo.py
import socket,time

for i in range(1,6):
    #socket.AF_INET表达TCP协议，socket.SOCK_STREAM
    mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    mysocket.connect(('localhost',554)) #跟服务器建立链接，包含三次握手，('localhost'-主机名，IP也可以,554-端口)
    msg = f'第{i}次发送的信息'
    mysocket.send(msg.encode('gb2312')) #发送数据
    mysocket.close()                    #断开连接，四次挥手
    time.sleep(2)














